
<%@page import="com.crossriver.crgis.database.model.Bank_Payment_Slip"%>
<%@page import="com.crossriver.crgis.database.service.TransactionsLocalServiceUtil"%>
<%@page import="com.crossriver.crgis.database.model.Transactions"%>
<%@ include file="/init.jsp"%>

<%@page import="java.text.SimpleDateFormat"%>
<%@page import="com.liferay.portal.kernel.util.PrettyDateFormat"%>


<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>

<portlet:defineObjects />

<%
Bank_Payment_Slip bankSlip = (Bank_Payment_Slip) request.getAttribute("bankSlip");
%>
<div id="main">
	<h1> Transactions &raquo; Bank Payment Slip Details</h1>
	<div class="content"> 
                
		<portlet:actionURL name="cancel" var="cancel">
		</portlet:actionURL>
		
		<portlet:actionURL name="confirmed" var="confirmed">
		</portlet:actionURL>

		<portlet:actionURL name="unconfirmed" var="unconfirmed">
		</portlet:actionURL>
				
		<hr>
		
		<aui:layout cssClass="test">
			<aui:column cssClass="bigtxt">
				Bank Payment Slip - Detail
			</aui:column>	
		</aui:layout>	
    
		     
    <table id="transdetails" width="50%">
    	<tr>
      	<td width="25%">Bank Deposit Slip No:</td>
      	<td width="75%" class="tdet"><%= bankSlip.getDepSlipNo() %></td>
			</tr>
		<tr>
      	<td width="25%">Registered Date:</td>
      	<td width="75%" class="tdet"><%= bankSlip.getRegistedDate() %></td>
			</tr>
			<tr>
			 	<td>Application ID:</td>
			 	<td class="tdet"><%=bankSlip.getApplicationId()  %></td>
			</tr>
			<tr>
				<td>Depositor Name:</td>
			  <td class="tdet"><%= bankSlip.getDepositorName()  %></td>
			</tr>
			<tr>
				<td>Paid Amount :</td>
				<td class="tdet"><%=bankSlip.getPaidAmount()  %></td>
			</tr>
			<tr>
				<td>Approved Amount:</td>
				<td class="tdet"><%= bankSlip.getApprovedAmount() %></td>
			</tr>
			<tr>
				<td>Bank Name:</td>
				<td class="tdet"><%= bankSlip.getBankName() %></td>
			</tr>
			<tr>
				<td>File Name:</td>
				
				<portlet:resourceURL  var="downloadSlip">
					<portlet:param name="slipNo" value="<%=bankSlip.getDepSlipNo()%>" />
					<portlet:param name="queryType" value="viewPaymentSlip" />
				</portlet:resourceURL>
				
				
				<td class="tdet">
				<a href="<%=downloadSlip.toString() %>">
					<%= bankSlip.getUploadDepositSlipFilename()  %>
				</a>
				
				</td>
			</tr>
			<tr>
				<td>Status:</td>
				<td class="tdet"><%= bankSlip.getStatus() %></td>
			</tr>
			
  	</table>		
		
		<hr>            
		<aui:layout cssClass="test">
			<aui:column>
				<input name="" type="button" value="Cancel" onClick="cancel();">
				<%
				if("NEW".equalsIgnoreCase(bankSlip.getStatus())){
				%>
				<input name="" type="button" value="Confirmed" onClick="confirmed();">
				<input name="" type="button" value="Unconfirmed" onClick="unconfirmed();">
				<%
				}
				%>
			</aui:column>	
		</aui:layout>	
    
  </div>
</div>

<liferay-portlet:actionURL name="cancel" var="cancel"></liferay-portlet:actionURL>

<form name="<portlet:namespace/>viewBankSlip_fm" method="post"	id="<portlet:namespace/>viewBankSlip_fm" action="<%=cancel.toString()%>">
	<aui:input type="hidden" name="slipNo" value="<%=bankSlip.getDepSlipNo()%>"></aui:input>
</form>


<liferay-portlet:actionURL name="confirmed" var="confirmed"></liferay-portlet:actionURL>

<form name="<portlet:namespace/>confirmedBankSlip_fm" method="post"	id="<portlet:namespace/>confirmedBankSlip_fm" action="<%=confirmed.toString()%>">
	<aui:input type="hidden" name="slipNo" value="<%=bankSlip.getDepSlipNo()%>"></aui:input>
</form>

<liferay-portlet:actionURL name="unconfirmed" var="unconfirmed"></liferay-portlet:actionURL>

<form name="<portlet:namespace/>unconfirmedBankSlip_fm" method="post"	id="<portlet:namespace/>unconfirmedBankSlip_fm" action="<%=unconfirmed.toString()%>">
	<aui:input type="hidden" name="slipNo" value="<%=bankSlip.getDepSlipNo()%>"></aui:input>
</form>


<script type="text/javascript">
<!--
	
	function cancel()
	{
		document.forms["<portlet:namespace/>viewBankSlip_fm"].submit();
	}

	function confirmed()
	{
		document.forms["<portlet:namespace/>confirmedBankSlip_fm"].submit();
	}
	
	
	function unconfirmed()
	{
		document.forms["<portlet:namespace/>unconfirmedBankSlip_fm"].submit();
	}


//-->
</script>